'use strict';

const Koa = require('koa');
const temp = require('./templating');
const controllers = require('./controllers');
const bodyparser = require('koa-bodyparser');
const staticFile = require('koa-static');
const model = require('./models');
const session = require('./session');

let app = new Koa();

app.use(session(app));

app.use(staticFile(__dirname));

app.use(bodyparser());

app.use(temp);

app.use(controllers());

// (async ()=>{
//     await model.sync();
// })();


let port = 5005;
app.listen(port);
console.log(`http://localhost:${port}`);